<?PHP

/*
 * 操作系统设置信息
 * 杨继康
 * 2012/07/22
 */

class System_Model extends CI_Model {

    //重载CI_Model
    public function __construct() {
        parent::__construct();
        $this->load->database();
    }

    //获取系统设置内容
    function get_system($str = FALSE) {

        $query = $this->db->get_where('db_systemsetup', array('s_marked' => $str));

        //返回结果
        foreach ($query->result() as $row) {
            return $row->s_content;
        }
    }

    //插入系统配置内容
    function insert_system($content) {
        $data = array(
            's_marked' => "login_title",
            's_content' => $content,
            's_state' => OBJ_STATE_VALID
        );
        $result = $this->db->insert('db_systemsetup', $data);
        return $result;
    }

}

?>